/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.leadiv.openrule;

import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import javax.swing.JLabel;

/**
 *
 * @author pborrego
 */
public class JVerticalLabel extends JLabel {

    public JVerticalLabel(String s) {
        super(s);
        this.setPreferredSize(new Dimension(14,90));
        this.setMinimumSize(new Dimension(14,90));
    }

    @Override
    public void paintComponent(Graphics g) {
        Graphics2D g2d = (Graphics2D)g;
        g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                            RenderingHints.VALUE_ANTIALIAS_ON);
        g2d.translate(12.0, 60.0);
        g2d.rotate(300);
        g2d.drawString(this.getText(), 0, 0);
    }
}
